<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" 
	xmlns:h="http://java.sun.com/jsf/html" 
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:a4j="http://richfaces.org/a4j" 
	xmlns:rich="http://richfaces.org/rich" 
	xmlns:p="http://primefaces.org/ui"
	xmlns:sigecComp="http://java.sun.com/jsf/composite/components">
	
	<h:outputStylesheet library="css" name="textos.css" />
	<h:outputStylesheet library="css" name="bordes.css" />
	<h:outputStylesheet library="css" name="botones.css" />

	<h:form id="frmPrograma">

		

		<rich:panel header="Programas" id="pnlCurso">
			<rich:collapsiblePanel header="#{msg.etiqueta_lista_programas}"  headerClass="headerDivCollap" styleClass="mainDivCollap" 
				leftCollapsedIcon="triangleDown" leftExpandedIcon="triangleUp" switchType="client">
				
				<p:dataTable value="#{listaProgramaController.lstProgramas}" var="programa" style="width:100%;" rows="15" paginator="true" 
					paginatorPosition="top" paginatorAlwaysVisible="false">
					<p:column>
						<f:facet name="header">
							<h:outputLabel value="#{msg.nombre}" />
						</f:facet>
						<a4j:commandLink value="#{programa.nombre}" action="#{listaProgramaController.btnProgramaDetail}" execute="@this">
							<f:setPropertyActionListener target="#{listaProgramaController.programaSelected}" value="#{programa}" />
							<f:setPropertyActionListener target="#{administrarProgramaController.programa}" value="#{programa}" />
						</a4j:commandLink>
					</p:column>
					
					<p:column>
						<f:facet name="header">
							<h:outputLabel value="#{msg.descripcion}" />
						</f:facet>
						<h:outputLabel value="#{programa.descripcion }" />
					</p:column>
				</p:dataTable>
			</rich:collapsiblePanel>
		</rich:panel>
		
		<rich:popupPanel id="popupPrograma" modal="true" autosized="true" resizeable="false" domElementAttachment="parent" header="Detalle programa">
	        <f:facet name="controls">
	        	<a4j:commandLink value="X" onclick="#{rich:component('popupPrograma')}.hide(); return false;"/>
	        </f:facet>
	        <h:panelGrid columns="2">
	        	<h:outputLabel value="#{msg.nombre }" />
	        	<h:outputText value="#{listaProgramaController.programaSelected.nombre }" />
	        </h:panelGrid>	
		</rich:popupPanel>
	</h:form>
</ui:composition>
